#include "inc/sched.h"

#include <linux/cpu.h>

static void do_idle(void)
{
    while (!need_resched())
    {

    }

    schedule_idle();
}

void __weak arch_cpu_idle_prepare(void) { }

void cpu_startup_entry(enum cpuhp_state state)
{
    current->flags |= PF_IDLE;
    arch_cpu_idle_prepare();
    cpuhp_online_idle(state);

    while (1)
    {
        do_idle();
    }
}
